package com.yuyou.train.service.api.user.service;

import java.util.List;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.yuyou.train.service.api.user.entity.User;
import com.yuyou.train.util.bean.ResBoolSimpleInfo;





@FeignClient(value = "train-user-service")
@RequestMapping(value = "/userAPI")
public interface UserAPI {
	
	/**
	 * 新增用户
	 * @param user
	 * @return
	 */
	@RequestMapping(value = "/insert")
	int insert(@RequestBody User user);
	
	/**
	 * 更新用户
	 * @param user
	 * @return
	 */
	@RequestMapping(value = "/update")
	int update(@RequestBody User user);
	
	/**
	 * 查找用户
	 * @param userId
	 * @return
	 */
	@RequestMapping(value = "/selectByUserId")
	User selectByUserId(@RequestParam("userId") String userId);

	
	/**
	 * 查找用户
	 * @param user
	 * @return
	 */
	@RequestMapping(value = "/findUsers")
	List<User> findUsers(@RequestBody User user);
	
	/**
	 * 根据电话号码查找用户
	 * @param phone
	 * @return
	 */
	@RequestMapping(value = "/selectUsersByPhone")
	User selectUsersByPhone(@RequestParam("phone") String phone);
	
	/**
	 * 重设密码
	 * @param password
	 * @return
	 */
	@RequestMapping(value = "/resetPass")
	ResBoolSimpleInfo resetPass(@RequestParam("phone") String phone,@RequestParam("password") String password);
	
	/**
	 * 获取用户属性
	 * @param userId 用户ID
	 * @param type 类型（01：科目，02：学段，03：标签）
	 * @return List<UserDataConfig>
	 */
	@RequestMapping(value = "/findUserDataConfig")
	List<String> findUserDataConfig(@RequestParam("userId") String userId,@RequestParam("type") String type);
	
	
}
